using System;
using System.Collections.Generic;
using System.Text;
using BoOnce.Xml;
using System.IO;
using BoOnce.Components;
using BoOnce.Graphics;
using BoOnce.Helpers;
using BoOnce.Core.Helpers;

namespace BoOnce.GameLogic
{
    class Punch
    {
        private const String PUNCH_DESCRUPTOR_NAME = "punch.info";
 
        private String Name;
        private int Damage;
        private float Distance;
        private Animation _Animation;

        public Punch(Animation anim,String animPath)
        {
            _Animation = anim;
            LoadPunchFromXml(animPath + "/" + PUNCH_DESCRUPTOR_NAME);
        }

        public static Boolean IsPunchAnimation(String animPath)
        {
            String filePath = animPath + "/" + PUNCH_DESCRUPTOR_NAME;
            return File.Exists(filePath);
        }

        private void LoadPunchFromXml(String xmlPath)
        {
            PunchXml xml = (PunchXml)XmlStorage.Load(xmlPath, typeof(PunchXml));
            Name = xml.Name;
            Damage = xml.Damage;
            Distance = xml.Distance;
        }
    }
}
